<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%-- <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> --%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GOYO系统管理平台</title>
   <link href="/resources/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
   <link href="/resources/css/admin_style.css" rel="stylesheet" type="text/css" />
   <script src="/resources/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
   <script type="text/javascript" src="/resources/lib/ligerUI/js/ligerui.all.js"></script>
   <script type="text/javascript" src="/resources/js/showCurTime.js"></script>
   <script type="text/javascript" src="/resources/js/comet4j.js"></script>
        <script type="text/javascript">
            var tab = null;
            var accordion = null;
            var tree = null;
            $(function (){
            	setInterval("showTime('showCurTime')", 1000);  
                //布局
                $("#layout1").ligerLayout({ leftWidth: 190, height: '100%',heightDiff:-34,space:4, onHeightChanged: f_heightChanged });

                var height = $(".l-layout-center").height();

                //Tab
                $("#framecenter").ligerTab({ height: height});

                //面板
                $("#accordion1").ligerAccordion({ height: height - 24, speed: null });

                $(".l-link").hover(function ()
                {
                    $(this).addClass("l-link-over");
                }, function ()
                {
                    $(this).removeClass("l-link-over");
                });
                //树
               /*  $("#tree1").ligerTree({
                    data : indexdata,
                    checkbox: false,
                    slide: false,
                    nodeWidth: 120,
                    attribute: ['nodename', 'url'],
                    onSelect: function (node)
                    {
                        if (!node.data.url) return;
                        var tabid = $(node.target).attr("tabid");
                        if (!tabid)
                        {
                            tabid = new Date().getTime();
                            $(node.target).attr("tabid", tabid)
                        } 
                        f_addTab(tabid, node.data.text, node.data.url);
                    }
                });
 */
                tab = $("#framecenter").ligerGetTabManager();
 					
 
 
 
                accordion = $("#accordion1").ligerGetAccordionManager();
                tree = $("#tree1").ligerGetTreeManager();
                $("#pageloading").hide();
                
                //消息推送开始
                var kbDom = document.getElementById('kb');
                JS.Engine.on({
                	task_prompt : function(msg){//侦听一个channel
                				var value = kbDom.innerHTML;
                				if(!msg)msg=0;
                				if(value){
                					 kbDom.innerHTML = Number(value) +Number(msg);
                					 if(Number(msg)>0){
                						 console.log("推送信息:"+msg);
                						$.ligerDialog.tip({  title: '信息提示',content:'你有 '+msg+' 条新信息需处理！'});
                					 }
                				}else{
                					kbDom.innerHTML = msg;
                				}
                        },
                    online_offline_prompt:function(info){
                    	var newtip = $.ligerDialog.tip({  title: '上线提示',content:info });
            			setTimeout(function () { newtip.close();}, 2000);
                    }
                });
                JS.Engine.start('/conn');
                JS.Engine.on('start',function(cId, channelList, engine){  
                    console.log('连接已建立，连接ID为：' + cId);  
                });  
                JS.Engine.on('stop',function(cause, cId, url, engine){  
                	console.log('连接已断开，连接ID为：' + cId + ',断开原因：' + cause + ',断开的连接地址：'+ url);  
                	JS.Engine.start('/conn');
                }); 
                
	
            });
            function f_heightChanged(options)
            {
                if (tab)
                    tab.addHeight(options.diff);
                if (accordion && options.middleHeight - 24 > 0)
                    accordion.setHeight(options.middleHeight - 24);
            }
            function f_addTab(tabid,text, url)
            {
            	if(tab.isTabItemExist(tabid)){
            		tab.reload(tabid);
            	}else{
            		tab.addTabItem({ tabid : tabid,text: text, url: url });
            	}
            }
            function changePassword(){
            	 openNewWindow('修改密码:',400,450,'/system/toChangePassword',null);
            }
            
            function showLog(){
            	openNewWindow('查看日志:',600,800,'/system/toShowLog',null);
            }
            
 			function showTaskMsg(){
 				$("#kb").text('');
 				openNewWindow('查看信息:',400,800,'/system/toShowTaskMsg',null);
 			}
            
            function openNewWindow(title,height,width,url,data){
            	$.ligerDialog.open({
        			height:height,
                    width: width,
                    title : title,
                    url: url, 
                    showMax: false,
                    showToggle: true,
                    showMin: false,
                    isResize: true,
                    slide: false,
                    data:data
                });
            }
     </script> 
<style type="text/css"> 
    body,html{height:100%;}
    body{ padding:0px; margin:0;   overflow:hidden;}  
    .l-link{ display:block; height:26px; line-height:26px; padding-left:10px; text-decoration:underline; color:#333;}
    .l-link2{text-decoration:underline; color:white; margin-left:2px;margin-right:2px;}
    .l-layout-top{background:#102A49; color:White;}
    .l-layout-bottom{ background:#E5EDEF; text-align:center;}
    #pageloading{position:absolute; left:0px; top:0px; background:white url('/resources/lib/images/loading.gif') no-repeat center; width:100%; height:100%;z-index:99999;}
    .l-link{ display:block; line-height:22px; height:22px; padding-left:16px;border:1px solid white; margin:4px;text-decoration:none;}
    .l-link-over{ background:#FFEEAC; border:1px solid #DB9F00;} 
    .l-winbar{ background:#2B5A76; height:30px; position:absolute; left:0px; bottom:0px; width:100%; z-index:99999;}
    .space{ color:#E7E7E7;}
    /* 顶部 */ 
	/* .l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('/resources/lib/images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;   */}
    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;background:url('/resources/lib/images/topicon.gif') no-repeat 10px 5px;}
    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
    .l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline}

 </style>
</head>
<body style="padding:0px;background:#EAEEF5;">  
<div id="pageloading"></div>
  
<div id="topmenu" class="l-topmenu">
    <!-- <div class="l-topmenu-logo">经销存管理系统 V1.0</div>
    <div class="l-topmenu-welcome">
       <span class="space"> 欢迎：</span><a href="https://me.alipay.com/daomi" class="l-link2" target="_blank">chenchuan</a> 
        <span class="space">|</span>
         <a href="http://bbs.ligerui.com" class="l-link2" target="_blank">代办事项(20)</a>
         <span class="space">|</span>
         <a href="/j_spring_security_logout" class="l-link2">退出</a>
    </div>  -->

<div class="top">
	<div class="top_about">	
            <a href="/system/main" class="help1" id="btn2">首页</a>
            <a href="javascript:showLog();" class="help2">日志</a>
            <a href="javascript:changePassword();" class="help3" >改密</a>
            <!-- <a href="#" class="help4">委托</a>
            <a href="#" class="help5">帮助</a> -->
            <a href="/j_spring_security_logout" class="help6">退出</a>
	</div>
	<div class="admin_logo">
  		<img src="<%=path%>/resources/images/admin_logo.jpg" /> 
  	</div>
	<!--<div class="top_nav">
			<ul>
				<li><a class="selected" href="#" >后台首页</a></li>
				<li><a href="#">用户中心</a></li>
				<li><a href="#">修改密码</a></li>&#8226;
			</ul>
	</div>-->
	<div class="top_member">
	欢迎您，<sec:authentication property="name"/> | <a href="javascript:showTaskMsg();"><strong><span id="kb"></span>条信息</strong></a> | <span id="showCurTime"></span>
	</div>
</div>
</div>

  <div id="layout1" style="width:99.2%; margin:0 auto; margin-top:4px; "> 
        <div position="left"  title="主要菜单" id="accordion1">
        			<c:forEach var="menu1" items="${list}" >
        				<div title="${menu1.name}">
        					<c:forEach var="menu" items="${menu1.menus}" >
        						<a class="l-link" style="position: relative;text-indent: 5px;" href="javascript:f_addTab('${menu.uuid}','${menu.name}','${menu.url}')"><img style="position: absolute;left:2px;top: 6px;display: block;" src="/resources/images/icon/topicon.gif" />${menu.name}</a> 
        					</c:forEach>
        				</div>
        			</c:forEach>
        		<!-- 	
                    <div title="系统管理">
                    <div style=" height:7px;"></div>
                        <a class="l-link" href="javascript:f_addTab('userManage','用户管理','/sysUser/toSysUserList')">用户管理</a> 
                        <a class="l-link" href="javascript:f_addTab('resourceManagement','资源管理','/sysResource/toSysResourceList')">资源管理</a>
                        <a class="l-link" href="javascript:f_addTab('roleManagement','角色管理列表','/sysRole/toSysRoleList')">角色管理</a>
                        <a class="l-link" href="javascript:f_addTab('menuManagement','菜单管理列表','/sysMenu/toSysMenuList')">菜单管理</a>
                        
                    </div>
                    <div title="字典表">
                        <a class="l-link" href="javascript:f_addTab('errorLog','部门','/sysDepGroup/toSysDepGroupList')">部门</a>
                    </div>
                     -->
        </div>
        <div position="center" id="framecenter"> 
            <div tabid="home" title="我的主页" style="height:300px" >
                <iframe frameborder="0" name="home" id="home" src="/system/welcome"></iframe>
            </div> 
        </div> 
        
    </div>
<div class="bottm">
	<span>技术支持：Goyo科技有限公司</span>
	<span>Copyright © 1999-2014, CSDN.NET, All Rights Reserved</span>
</div>
    <div style="display:none"></div>
</body>
</html>
